#include <iostream>
#include <memory>
#include "tcpserver.hpp"


void usage(const std::string& proc)
{
    std::cout << "\n\rUsage : " << proc << "ServerPort\n" << std::endl;
}


int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        usage(argv[0]);
        exit(0);
    }
    uint16_t server_port = std::stoi(argv[1]);
    std::unique_ptr<TcpServer> tcpsvr(new TcpServer(server_port));

    tcpsvr->init();

    tcpsvr->run();

    return 0;
}